<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>后台分组管理</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__ADMIN__css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__ADMIN__css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__ADMIN__css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__ADMIN__css/animate.min.css" rel="stylesheet">
    <link href="__ADMIN__css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="__ADMIN__css/page.css" rel="stylesheet">
    <link href="__ADMIN__css//plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="__ADMIN__js/plugins/layer/laypage/skin/laypage.css" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>分组列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="row m-b-sm m-t-sm">
                        <div class="col-md-2">
                            <a  class="btn btn-primary btn-outline active" href="{:U('Group/add')}" aria-pressed="true"><i class="fa fa-user-plus"></i>添加分组</a>
                        </div>
                    </div>
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>分组名</th>
                            <th>规则</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="list" id="list">
                            <tr>
                                <td>{$list.id}</td>
                                <td>{$list.title}</td>
                                <td>{$list.rules}</td>
                                <if condition="$list.id eq 1 ">
                                    <td><a class="btn btn-primary btn-rounded disabled" href="#"><i class="fa fa-check"></i>正常</a></td>
                                    <elseif condition="$list.status eq 1 " />
                                    <td><a class="btn btn-primary btn-rounded" href="javascript:changeGroup({$list.id})" id="status{$list.id}"><i class="fa fa-check"></i>正常</a></td>
                                    <else />
                                    <td><a class="btn btn-danger btn-rounded" href="javascript:changeGroup({$list.id})" id="status{$list.id}"><i class="fa fa-remove"></i>禁用</a></td>
                                </if>
                                <if condition="$list.id eq 1 ">
                                    <td><a class="btn btn-success " type="button" href="{:U('Admin/group/rule?id='.$list['id'])}"><i class="fa fa-plus"></i>分配权限</a><a class="btn btn-default btn-rounded disabled" href="#"><i class="fa fa-trash"></i>删除</a> <a class="btn btn-default btn-rounded disabled" href="#"><i class="fa fa-edit"></i>修改</a></td>
                                    <else />
                                    <td><a class="btn btn-success " type="button" href="{:U('Admin/group/rule?id='.$list['id'])}"><i class="fa fa-plus"></i>分配权限</a><a class="btn btn-danger btn-rounded" href="javascript:delGroup({$list.id})"><i class="fa fa-trash"></i>删除</a> <a class="btn btn-info btn-rounded" href="{:U('Group/edit?id='.$list['id'])}"><i class="fa fa-edit"></i>修改</a></td>
                                </if>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

</div>
<script src="__ADMIN__js/jquery.min.js?v=2.1.4"></script>
<script src="__ADMIN__js/bootstrap.min.js?v=3.3.6"></script>
<script src="__ADMIN__js/plugins/peity/jquery.peity.min.js"></script>
<script src="__ADMIN__js/content.min.js?v=1.0.0"></script>
<script src="__ADMIN__js/plugins/iCheck/icheck.min.js"></script>
<script src="__ADMIN__js/demo/peity-demo.min.js"></script>
<script src="__ADMIN__js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__ADMIN__js/plugins/layer/layer.min.js"></script>
<script src="__ADMIN__js/plugins/layer/laypage/laypage.js"></script>

<script>
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script>
    function delGroup(id){
        var isConfirm;
        swal({
                title: "您确定要删除这条信息吗?",
                text: "删除后将无法恢复，请谨慎操作！",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "是的，我就是要删除！",
                cancelButtonText: "师傅刹一脚...",
                closeOnConfirm: false,
                closeOnCancel: false
                },
                function(isConfirm){
                    if (isConfirm) {
                        $.ajax({
                            type:"post",
                            url:"{:U('Group/groupDel')}",
                            dataType:"json",
                            data:{"id":id}
                        }).done(function(data){
                            swal({
                                title:data.title,
                                text:data.msg,
                                type:data.status,
                                confirmButtonText: "OK！"
                            },function(){
                                window.location.href="{:U('Group/index')}";
                            });
                        }).error(function(data) {
                            swal("OMG", "删除操作失败了!", "error")
                        });
                    } else {
                        swal("已取消", "您取消了删除操作！", "error");
                    }
                }
        );
        function goto(){
            window.location.href="{:U('Group/index')}";
        }
    }
    function changeGroup(id){
        var object = $('#status'+id);
        $.post(
                "{:U('Group/groupChange')}",
                {id:id},
                function(data){
                    if(data.status == 0){
                        layer.msg(data.msg, {icon: 5,time: 1000});
                    }else{
                        if(data.state > 0){
                            object.html("<i class='fa fa-check'></i>正常</a>").removeClass("btn btn-danger btn-rounded").addClass("btn btn-primary btn-rounded");
                            layer.msg(data.msg, {icon: 6,time: 1000});
                        }else{
                            object.html("<i class='fa fa-remove'></i>禁用</a>").removeClass("btn btn-primary btn-rounded").addClass("btn btn-danger btn-rounded");
                            layer.msg(data.msg, {icon: 6,time: 1000});
                        }
                    }
                },'json'
        );
    }
</script>
</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->
</html>
